home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************\
-
- File: demo graphics.c
-
- Purpose: This module handles updating the main window (in the
- offscreen bitmaps).
-
-
- MSG Demo -- graphic effects demonstration program
- Copyright (C) 1992-3 Mark Pilgrim & Dave Blumenthal
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program in a file named "GNU General Public License".
- If not, write to the Free Software Foundation, 675 Mass Ave,
- Cambridge, MA 02139, USA.
-
- \**********************************************************************/
-
- #include "demo graphics.h"
- #include "demo.h"
-
- void DrawBoardColor(void)
- {
- RGBColor oldForeColor, oldBackColor;
- GrafPtr curPort;
-
- GetForeColor(&oldForeColor);
- GetBackColor(&oldBackColor);
-
- GetPort(&curPort);
-
- EraseRect(&(curPort->portRect));
- if (!gWhichWipe)
- gWhichPict=!gWhichPict;
- if(gWhichPict)
- {
- HLock(gPict1);
- DrawPicture(gPict1, &(curPort->portRect));
- HUnlock(gPict1);
- }
- else
- {
- HLock(gPict2);
- DrawPicture(gPict2, &(curPort->portRect));
- HUnlock(gPict2);
- }
- if (!gWhichWipe)
- gWhichPict=!gWhichPict;
-
- RGBForeColor(&oldForeColor);
- RGBBackColor(&oldBackColor);
- }
-
- void DrawBoardBW(void)
- {
- GrafPtr curPort;
-
- GetPort(&curPort);
-
- EraseRect(&(curPort->portRect));
- if (!gWhichWipe)
- gWhichPict=!gWhichPict;
- if(gWhichPict)
- {
- HLock(gPict3);
- DrawPicture(gPict3, &(curPort->portRect));
- HUnlock(gPict3);
- }
- else
- {
- HLock(gPict4);
- DrawPicture(gPict4, &(curPort->portRect));
- HUnlock(gPict4);
- }
- if (!gWhichWipe)
- gWhichPict=!gWhichPict;
- }
-